﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace LinkShareWpf.ValidationRules
{
    class NumberValidator : ValidationRule
    {
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            UInt32 val;
            if (UInt32.TryParse(value.ToString(), out val))
            {
                return ValidationResult.ValidResult;
            }
            return new ValidationResult(false, "Il valore inserito non corrisponde ad un formato numerico valido");
            
        }
    }
}
